#include "Logger.h"

Logger::Logger(void)
{
}

Logger::~Logger(void)
{
}

Logger* Logger::getInstance()
{
	static Logger instance;
	return &instance;
}

Log* Logger::pushLog( Log& log )
{
	logStore.push_back(log);
	logQueue.push(&logStore.back());
	return &logStore.back();
}

void Logger::printAllLog()
{
	ofstream out;
	out.open(EVENTS_OUTPUT_FILENAME);

	while (!logQueue.empty())	{
		logQueue.top()->printResult(out);
		logQueue.pop();
	}
	out.close();
}